package com.project.common.exception;

/**
* @Description:   注册异常
* @Author:         wangzhiqiang
* @CreateDate:     2019-06-17 17:38
* @Version:        1.0
*/
public class RegisterException extends RuntimeException{
    private static final long serialVersionUID = -7413811431074157970L;

    /**
     * Construct a new exception
     */
    public RegisterException() {
        super();
    }

    /**
     * Construct a new exception with the detail message.
     * @param message The detail message
     */
    public RegisterException(String message) {
        super(message);
    }

    /**
     * Construct a new exception with the cause and a derived
     * detail message.
     * @param cause The underlying cause
     */
    public RegisterException(Throwable cause) {
        this(cause == null ? null : cause.toString(), cause);
    }

    /**
     * Construct a new exception with the detail message and cause.
     * @param message The detail message
     * @param cause The underlying cause
     */
    public RegisterException(String message, Throwable cause) {
        super(message + " (Caused by " + cause + ")");
        this.cause = cause;
    }

    /**
     * Construct a new exception with the detail message and cause.
     * @param code The underlying code
     * @param message The detail message
     */
    public RegisterException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    /**
     * The underlying cause of this exception.
     */
    protected Throwable cause = null;

    /**
     * exception code
     */
    protected Integer code = null;

    /**
     * Return the underlying cause of this exception (if any).
     */
    public Throwable getCause() {
        return this.cause;
    }

    /**
     * Return the underlying code of this exception (if any).
     */
    public Integer getCode() {
        return this.code;
    }
}
